<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <?php include_once MvcReg::$_moduleName . '/views/layout/head.php'; ?>
</head>
<body>
<?php include_once MvcReg::$_moduleName . '/views/layout/woody-prompt.php'; ?>
<?php include_once MvcReg::$_moduleName . '/views/layout/header.php'; ?>
<div id="main">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <?php include_once MvcReg::$_moduleName . '/views/layout/left_menu.php'; ?>
            </div>
            <div class="col-md-10">
                <div class="right-content">
                    <h3>
                        <ol class="breadcrumb">
                            <li><a href="?md=manage&cl=order&at=orderErrorList"><i class="fa fa-dashboard"></i><?php echo $menu["breadcrumb_current"] ?></a></li>
                        </ol>
                    </h3>
                    <br>
                    <form name="mainform" action="" method="get">
                    <?php echo $hidden_data?>
                    <div class="table-responsive">
                        <div class="panel panel-default">
                            <div class="panel-body form-inline">

                                <div class="form-group">
                                    <label>配货单号:</label>
                                    <input type="text" name="_ph_no"
                                           value="<?php echo $_ph_no ?>"
                                           class="form-control input-sm" placeholder=""/>
                                </div>

                                <div class="form-group">
                                    <label>订单号:</label>
                                    <input type="text" name="_order_no"
                                           value="<?php echo $_order_no ?>"
                                           class="form-control input-sm" placeholder=""/>
                                </div>

                                <div class="form-group">
                                    <label>订单状态:</label>
                                    <?php echo Tools::selectOptions("_eorder_status", Data::$_eorder_status_code, '全部', true, $_eorder_status, 'class="form-control select"'); ?>
                                </div>


                                    <button type="submit" class="btn btn-primary"><span
                                                class="glyphicon glyphicon-search"></span>立即查询
                                    </button>

                                <div class="floatright">
                                    <div class="dataTables_filter">
                                        <a href="javascript:;" onclick="exp('<?php echo $_ph_no ?>','<?php echo $_order_no ?>','<?php echo $_eorder_status ?>')" class="btn btn-primary"><b>汇出</b></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="table table-hover">
                            <thead>
                            <tr class="info">
                                <th>序</th>
                                <th>配货单号</th>
                                <th>订单编号</th>
                                <th>配送门店</th>
                                <th>订单状态</th>
                                <th>配送方式</th>
                                <th>订单来源</th>
                                <th>状态</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            if($rsp_list){
                                $n = 0;
                                foreach ($rsp_list as $k => $row) {
                                    $n++;
                                    $item = $n + ($page - 1) * $number_page;
                                    $id = $row["id"];
                                    $express_type = Data::$_express_type[$row["express_type"]] ;
                                    if ($row['express_type'] == "no") {
                                        $express_type= "<label class='red'>".$express_type."</label>";
                                    }
                                    $status = Data::$_eorder_status_code[$row['status']];


                                ?>
                                <tr data-id="<?php echo $id?>">
                                    <td><?php echo $item ?></td>
                                    <td><?php echo $row["ph_no"] ?></td>
                                    <td><?php echo $row["order_no"] ?></td>
                                    <td><?php echo $row["shop_name"] ?></td>
                                    <td><?php echo $status ?></td>
                                    <td><?php echo $express_type ?></td>
                                    <td><?php echo $row["source"] ?></td>
                                    <td>
                                        <input name="input" value="查看"
                                               onclick="edit('<?php echo $id; ?>', '<?php echo $page; ?>','<?php echo $this_url?>_check')"
                                               type="button" class="btn btn-success btn-sm"/>
                                    </td>
                                </tr>
                            <?php   }} ?>
                            </tbody>
                        </table>
                        <div class="page">
                                <div class="pagination pull-left">共<?php echo $total_count ?>笔记录</div>
                                <?php if (!empty($rsp_page_list)) echo $rsp_page_list; ?>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php include_once MvcReg::$_moduleName . '/views/layout/footer.php'; ?>
<script>
    function exp(_ph_no,_order_no,_order_status) {
        window.location.href = "?md=manage&cl=order&at=Error_export&_ph_no="+_ph_no+"&_order_no="+_order_no+"&_order_status="+_order_status;
    }
</script>
</body>
</html>
